<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <link rel="stylesheet" href="layui/css/layui.css">
    <script src="layui/layui.js"></script>

    <style>
        @media only screen and (min-width: 600px) {
            /* For tablets: */
            #left{
                background: green;
            }
            #right{
                background: red;
            }
        }
        @media only screen and (min-width: 768px) {
            /* For desktop: */
            #left{
                background: green;
            }
            #right{
                background: red;
            }
        }
        @media only screen and (min-width: 900px) {
            /* For desktop: */
            #left{
                background: orange;
            }
            #right{
                background: blue;
            }
        }
        @media only screen and (min-width: 1100px) {
            /* For desktop: */
            #left{
                background: black;
            }
            #right{
                background: greenyellow;
            }
        }
    </style>
    <script type="text/javascript">
        // 判断是否为移动设备
        function isMobile() {
            if((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
                return true;
            } else {
                return false;
            }
        }

        if(isMobile()) {
            document.write("<Meta name=\"WT.mc_ev\" content=\"1706rwxT\">");
        } else {
            document.write("<Meta name=\"WT.mc_ev\" content=\"1706rwxPC\">");
        }
    </script>
    <meta name="WT.mc_ev" content="1706rwxT">
    <script type="text/javascript">
        (function(doc, win) {
            var docEl = doc.documentElement,
                resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
                recalc = function() {
                    var clientWidth = docEl.clientWidth;
                    if(!clientWidth) return;
                    docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; //46.875
                };
            if(!doc.addEventListener) return;
            win.addEventListener(resizeEvt, recalc, false);
            doc.addEventListener('DOMContentLoaded', recalc, false);
        })(document, window);
    </script>

</head>
<body>

<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<div class="layui-container">
    <blockquote class="layui-elem-quote">注意：下述演示中的颜色只是做一个区分作用，并非栅格内置。</blockquote>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>始终等比例水平排列</legend>
    </fieldset>

    <div class="layui-row">
        <div class="layui-col-xs6">
            <div id="left"  class="grid-demo grid-demo-bg1">6/12</div>
        </div>
        <div class="layui-col-xs6">
            <div id="right" class="grid-demo">6/12</div>
        </div>
    </div>
</div>

<div style="width: 5rem;height: 3rem;background: cornflowerblue">

</div>

</body>
</html>
<script>
    var device = layui.device();
    console.log(device.ie)
</script>